SET(TARGET_NAME "doxmlparser")
SET(TARGET_DIR bin/${BIN_FOLDER}/modules/)

INCLUDE_DIRECTORIES (../include)
INCLUDE_DIRECTORIES (qtools)

INCLUDE_DIRECTORIES(${LUA_INC_DIR})
LINK_DIRECTORIES (${LUA_LIB_DIR})

INCLUDE_DIRECTORIES(${LUABIND_INC_DIR})
LINK_DIRECTORIES (${LUABIND_LIB_DIR})

INCLUDE_DIRECTORIES(${BOOST_INC_DIR})
LINK_DIRECTORIES (${BOOST_LIB_DIR})

ADD_DEFINITIONS(-DQT_LARGEFILE_SUPPORT)
ADD_DEFINITIONS(-DQT_LITE_UNICODE)

FILE(GLOB_RECURSE PUBLIC_HEADERS "../include/*.h")

# FILE(GLOB_RECURSE COMMON_SOURCE_FILES "parser/*.cpp" "qtools/*.cpp" "*_wrap.cxx")
FILE(GLOB_RECURSE COMMON_SOURCE_FILES "parser/*.cpp" "qtools/*.cpp" "*_bindings.cxx")

IF(WIN32)
    FILE(GLOB_RECURSE SPECIFIC_SOURCE_FILES "win32/*.cpp")
ELSE()
    FILE(GLOB_RECURSE SPECIFIC_SOURCE_FILES "unix/*.cpp")
ENDIF()

ADD_LIBRARY (${TARGET_NAME} SHARED ${PUBLIC_HEADERS} ${COMMON_SOURCE_FILES} ${SPECIFIC_SOURCE_FILES})

SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
	PREFIX ""
	SUFFIX ".sgp")
	
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LUABIND_LIBS} ${LUA_LIBS})  

INSTALL(TARGETS ${TARGET_NAME}
	RUNTIME DESTINATION ${TARGET_DIR}
	LIBRARY DESTINATION ${TARGET_DIR})
	